|
A barrel shifter is a digital circuit that can shift a data word by a specified number of bits in one clock cycle. It can be implemented as a sequence of multiplexers (mux.), and in such an implementation the output of one mux is connected to the input of the next mux in a way that depends on the shift distance. For example, take a four-bit barrel shifter, with inputs A, B, C and D. The shifter can cycle the order of the bits ''ABCD'' as ''DABC'', ''CDAB'', or ''BCDA''; in this case, no bits are lost. That is, it can shift all of the outputs up to three positions to the right (and thus make any cyclic combination of A, B, C and D). The barrel shifter has a variety of applications, including being a useful component in microprocessors (alongside the ALU). == Implementation == A barrel shifter is often implemented as a cascade of parallel 2×1 multiplexers. For a 8-bit barrel shifter, two intermediate signals are used which shifts by four and two bits, or passes the same data, based on the value of S() and S(). This signal is then shifted by another multiplexer, which is controlled by S(): int1 = IN , if S() == 0 = IN << 4, if S() == 1 int2 = int1 , if S() == 0 = int1 << 2, if S() == 1 OUT = int2 , if S() == 0 = int2 << 1, if S() == 1 Larger barrel shifters have additional stages. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Barrel shifter」の詳細全文を読む スポンサード リンク
|